<template>
	<div>
		<DetailPage v-bind="BlockchainConfig" :model="baseInfo" style="width: 100%; margin: 0 auto"> 
		</DetailPage>
		<div class="isAuth" v-if="baseInfo.empowerState==2">机构已获得老人授权</div>
        <div>
            <div  class="top_part" style="margin-left: 20px;">
                <div class="node-label">老人基本数据</div>
                <div class="tag_btn" @click="dialogVisible=true">老人可信数据档案</div>
            </div>
            <DetailPage v-bind="beliveDataConfig" :model="baseInfo" style="width: 100%; margin: 0 auto">
		    </DetailPage>
        </div>
        <aplid-dialog
			whickComm="Archives"
			v-model="dialogVisible"
			width="65%"
			:customeHeader="customeHeader"
			title="档案信息"
			append-to-body
			:close-on-click-modal="false"
			pageName="服务对象"
			:model="detailHeadData?detailHeadData:baseInfo"
		>
			<Archival :nowRowData="nowRowData"></Archival>
		</aplid-dialog>
	</div>
</template>

<script setup lang="ts">
import { getAreaObj } from '@/utils/util'
import DetailPage from '@/views/aplid/DetailPage/index.vue'
import { BlockchainConfig,beliveDataConfig } from './config'
import apiMod from '@/apiMod/index'
import Archival from './Archival.vue'
import { useCommonStore } from '@/stores/common'
const { detailHeadData } = storeToRefs(useCommonStore())

let baseInfo:any = ref({})
let props = defineProps({
    nowRowData:{
        type:Object,
        default:()=>({})
    }
})
baseInfo.value= props.nowRowData
let dialogVisible = ref()
const customeHeader = {
	type: 'CardTwo',
	title: 'name',
	avatar: 'image',
	tipList: [{ prop: 'telephone', type: 'tip-success', label: '联系电话' }],
	tagList: [
		{
			prop: 'countryLevel',
			propName: 'countryLevelLabel',
			code: 'ACCESS_LEVEL_COUNTRY',
			custome: 'tag',
			type: 'success',
			label: '能力等级',
		},
		{ prop: 'birthday', type: 'success', label: '公历' },
		{ prop: 'lunarBirthday', type: 'success', label: '农历' },
	],
	menuBtn: [],
}

</script>

<style lang="scss" scoped>
.tag_btn{
    width: 144px;
    height: 25px;
    line-height: 25px;
    border-radius: 4px;
    background: #0052d9;
    font-weight: 400;
    font-size: 14px;
    text-align: center;
    color: #fff;
}
.top_part{
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-content: center;
}
.title_part{
    font-weight: 700;
    font-size: 16px;
    text-align: left;
    color: #0a2654;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-right: 32px;
}
.record_part {
	padding: vw(20);
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: flex-start;
    .desc_part{
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        .prop_part{
            margin: 10px 0;
        }
    }
	.page_part {
		align-self: flex-end;
	}
}
.time_org{
    font-family: "Microsoft YaHei";
    font-weight: 400;
    font-size: 16px;
    text-align: left;
    color: #000;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    .org_name{
        padding: 2px 4px;
        height: 25px;
        border-radius: 4px;
        background: #FEF9EB;
        font-family: "Microsoft YaHei";
        font-weight: 400;
        font-size: 16px;
        text-align: center;
        color: #ecbb18;
        margin-left: 39px;
    }
}
.edit_user{
    font-family: "Microsoft YaHei Bold";
    font-weight: 700;
    font-size: 16px;
    text-align: left;
    color: #000000e6;
}
.isAuth{
	display: inline-block;
	padding: 0 6px;
	background-color: #F9B7B4;
	font-family: "Microsoft YaHei";
	font-weight: 400;
	font-size: 16px;
	text-align: left;
	color: #fa3e3e;
	height: 25px;
	border-radius: 4px;
}
</style>
